FROM yzq6431/php74:v1

#挂在卷
VOLUME ["/var/www","/wwwroot","/supervisor_conf"]

COPY ./conf/php.ini /usr/local/bin/php/lib/php.ini

#先安装libzip高版本

COPY ./libzip-1.2.0.tar.gz /tmp/libzip-1.2.0.tar.gz

RUN yum remove libzip && tar -zxvf /tmp/libzip-1.2.0.tar.gz && cd /tmp/libzip-1.2.0 && ./configure && make && make install

ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

#安装php的openssl
RUN yum install -y openssl openssl-devel libpng-devel libzip libzip-devel && cd /tmp/php-7.4.14/ext/openssl/ && cp ./config0.m4 ./config.m4 && phpize && ./configure --with-php-config=/usr/local/bin/php/bin/php-config && make && make install && \
        cd /tmp/php-7.4.14/ext/gd && phpize && ./configure --with-php-config=/usr/local/bin/php/bin/php-config && make && make install && \
        cd /tmp/php-7.4.14/ext/zip && phpize && ./configure --with-php-config=/usr/local/bin/php/bin/php-config && make && make install && \
        cd /tmp/php-7.4.14/ext/zlib && cp config0.m4 config.m4 && phpize && ./configure --with-php-config=/usr/local/bin/php/bin/php-config && make && make install 

#安装supervisor
COPY ./conf/supervisord.conf /etc/supervisor/supervisord.conf

RUN yum install -y python-pip && pip install supervisor && touch /tmp/supervisor.sock && unlink /tmp/supervisor.sock

COPY ./init.sh /init.sh

RUN chmod 777 /init.sh

CMD [ "/init.sh" ]

EXPOSE 9001 88